package demo.ui;

import java.awt.Container;
import java.awt.Graphics;
import java.awt.GridLayout;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextField;

public class MyPaint extends JPanel{
	Image bmp;
	public MyPaint(){
		bmp = Toolkit.getDefaultToolkit().getImage("D:\\images.jpg");
	}
	
	@Override
	protected void paintComponent(Graphics g) {
		super.paintComponent(g);
		myPaintMethod(g);
		System.out.println("Method paintComponent duoc goi");
	}
	
	private void myPaintMethod(Graphics g){
		g.drawImage(bmp, 0, 0, null);
	}
	
}